FROM python:3.9-alpine3.20

ENV ANSIBLE_VERSION=2.10.6
ENV LANG="en_US.UTF-8"
ENV LANGUAGE="en_US:en"
ENV LC_ALL="en_US.UTF-8"
ENV TZ="Asia/Shanghai"
ENV PS1='[in_container]\e[1;31m\[\u\e[1;37m@\e[1;33m\h\]\e[1;37m:\e[1;34m$(pwd)\e[1;31m #\e[0m '

# ADD https://github.com/cloudflare/cfssl/releases/download/v1.6.5/cfssl_1.6.5_linux_amd64 /usr/bin/cfssl
# ADD https://github.com/cloudflare/cfssl/releases/download/v1.6.5/cfssljson_1.6.5_linux_amd64 /usr/bin/cfssljson

RUN apk --no-cache add --virtual build-dependencies \
        gcc \
        musl-dev \
        python3-dev \
        libffi-dev \
        openssl-dev \
        cargo \
        build-base \
    && apk --no-cache add \
        bash \
        openssh-client \
        rsync \
        vim \
        jq \
        net-tools \
        bind-tools \
        curl \
        busybox-extras \
        openssl \
    && pip install pip --upgrade \
    && pip install --no-cache-dir \
        ansible=="${ANSIBLE_VERSION}" \
    && ln -s -f /usr/local/bin/python3 /usr/bin/python \
    && ln -s -f /usr/local/bin/python3 /usr/bin/python3 \
    && apk del build-dependencies \
    && rm -rf /var/cache/apk/* \
    && rm -rf /root/.cache \
    && rm -rf /root/.cargo \
    && echo -e "alias ll='ls -lah'\nalias tailf='tail -f'" >> ~/.bashrc
#    && chmod +x /usr/bin/cfssl*

CMD [ "sleep", "3155760000" ]
